import { getWaitCheckStatementOrder } from '@/api/order'
import { ref } from 'vue'
import { WaitOrderStatementCheck } from '../types'

const useOrderWaitCheckFinishInfo = () => {
  const getOrderWaitCheckFinishInfoLoading = ref(false)
  const orderWaitCheckFinishInfo = ref<WaitOrderStatementCheck | null>(null)
  const getOrderWaitCheckFinishInfo = async (id: string) => {
    getOrderWaitCheckFinishInfoLoading.value = true
    const res = await getWaitCheckStatementOrder(id)
    orderWaitCheckFinishInfo.value = res.data.data.row
    getOrderWaitCheckFinishInfoLoading.value = false
  }

  return {
    orderWaitCheckFinishInfo,
    getOrderWaitCheckFinishInfoLoading,
    getOrderWaitCheckFinishInfo,
  }
}

export default useOrderWaitCheckFinishInfo
